import React from "react";
import { Empty, Skeleton } from "antd";

interface Props {
  isLoading?: boolean;
  style?: object;
  noData?: boolean;
  error?: string | null;
  onRefresh?: () => void;
  children?: React.ReactElement;
  bgcolor?: string;
  [s:string]:any
}
// display: "flex",
// padding: 56,
// justifyContent: "center",
// alignItems: "center",
// flexDirection: "column",
// gap: 6,
// boxSizing: 'border-box'



const EmptyState: React.FC<Props> = ({
  loading,
  description,
  children = null,
  empty,
  ...props
}) => {
  if (loading) {
    return (
      <div {...props}>
        <Skeleton active />
      </div>
    );
  }

  if (empty) {
    return (
      <div {...props}>
        <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />
      </div>
    );
  }

  return children;
};

export default EmptyState